// #include <gtest/gtest.h>

// // Test cases for MyLib
// TEST(MyLibTest, BasicTest) {
//     EXPECT_EQ(1, 1);
// }


#include <gtest/gtest.h>
 
// 被测试的函数
int Factorial(int n) {
    if (n == 0)
        return 1;
    else
        return n * Factorial(n - 1);
}
 
// 测试套件
TEST(FactorialTest, PositiveNumber) {
    EXPECT_EQ(1, Factorial(1));
    EXPECT_EQ(2, Factorial(2));
    EXPECT_EQ(6, Factorial(3));
    EXPECT_EQ(40320, Factorial(8));
}
 
TEST(FactorialTest, NegativeNumber) {
    EXPECT_ANY_THROW(Factorial(-1));
}
 
int main(int argc, char **argv) {
    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}

